<%= render :partial=>"layouts/header" %>
<div id="gallery_title">
    <%=Settings.get_gallery_name.value%>
</div>
<% if flash[:notice] -%>
<div id="notice"><%= flash[:notice] %></div>
<% end -%>
 <% if logged_in? %>
   <div class="left_menu">
    <div class="main_menu">
     <h2><%= _('Menu') %></h2>
     <ul>
         <li><%= link_to image_tag("/stylesheets/"+get_scheme+"/images/images")+_(" Albums"), :controller=>"admin", :action=>"album_list" %></li>
         <li><%= link_to image_tag("/stylesheets/"+get_scheme+"/images/tags.bmp")+_(" Tags"), :controller=>"admin", :action=>"tag_settings" %></li>
         <li><%= link_to image_tag("/stylesheets/"+get_scheme+"/images/settings")+_(" Settings"), :controller=>"admin", :action=>"gallery_settings" %></li>
		 <li><%= link_to image_tag("/stylesheets/"+get_scheme+"/images/editalbum")+_(" Synchronize"), :controller=>"admin", :action=>"synchronize" %></li>
     </ul>
    </div>
    <div class="admin_menu">
     <h2><%= _('Admin') %></h2>
     <ul>
      <% if params[:controller] == 'admin' and params[:action] == 'album_list' %>
          <li><%= link_to image_tag("/stylesheets/"+get_scheme+"/images/images")+_(" New Album"), :controller=>"albums", :action=>"new" %></li>
      <%end%>
      <% if params[:controller] == 'admin' and params[:action] == 'album_page' %>
          <li><%= link_to image_tag("/stylesheets/"+get_scheme+"/images/image_add")+_(" Add Photo to album"), :controller=>"admin", :action=>"new_photo",:id=>     @album %></li>
          <li><%= link_to image_tag("/stylesheets/"+get_scheme+"/images/editalbum")+_(" Edit Album"), :controller=>"albums", :action=>"edit" ,:id=>@album%></li>
          <li><%= link_to image_tag("/stylesheets/"+get_scheme+"/images/trash.gif")+_(" Delete Album"), {:controller=>"albums", :action=>"destroy", :id=>@album},:onclick => "return confirm(\"#{_('All photos in album will be deleted. Are you sure you want to delete album')}\" + ' \"#{@album.title}\"?');",:class => "desctructive" %>
      <%end%>
     </ul>
     </div>
     <div class="albums">
      <h2><%= _('Photo Albums') %></h2>
      <ul>
       <% Album.find(:all).each do |album| %>
       <li id="album_<%= album.id %>"><%= render(:partial=>"admin/album",:locals=>{:album=>album}) %></li>
       <%= drop_receiving_element "album_#{album.id}",
           :update => "album_#{album.id}", :url => { :controller=>"albums", :action=>"add_photo", :album_id=>album },
           :accept => "photo", :hoverclass => "album-active",
           :loading => "Element.show('album_spinner')",
           :complete => "Element.hide('album_spinner')" if logged_in? %>
       <% end %>
      </ul>
      <div id="album_spinner" style="display:none;clear:both"><%= image_tag "/stylesheets/"+get_scheme+"/images/spinner.gif", :style=>"vertical-align:middle" %><%= _(' Adding photo to album...') %></div>
     </div>
     <div id="login_link">
      <%= logged_in? ? @curuser.full_name+" "+link_to(_("Logout"), :controller=>"account", :action=>"logout") : link_to(_("Login"), :controller=>"account", :action=>"login") %>
     </div>
      </div> <% end %>
<%= @content_for_layout %>
<div class="clearfooter"></div>
</div>
<div class="quickmenu"><a href="/gallery/">[<%= _("Albums") %>]</a>&nbsp;
<%if Settings.get_need_login and not logged_in?%>
         <%= link_to("["+_("Log In")+"]", :controller=>"account", :action=>"login") %><% end %>
&nbsp;<%= link_to("["+_("Tags")+"]", :controller=>"view", :action=>"tags") %>&nbsp;&nbsp;
</div>
<div class="footer">
Powered by&nbsp;<%= link_to "Tableau", "http://creativi.st/tableau" %>
</div>
</body>
</html>
